package c2.advanced.share;

import c2.advanced.server.configuration.SetupContext;
import cp.solution.business.game.status.CrossStatusReport;
import cp.solution.business.game.status.GroupStatusReport;
import cp.solution.manage.PrimaryClient;
import cp.solution.manage.api.open.OpenApi;
import cp.solution.manage.cache.PrimaryLoader;
import cp.solution.pattern.Feedback;
import lombok.Getter;
import lombok.experimental.Accessors;

public class ApiFacade {

    private String selfCode;
    private PrimaryClient pc;
    private PrimaryLoader pl;

    @Getter
    @Accessors(fluent = true)
    private OpenApi openApi;

    public void setup(SetupContext context) {
        selfCode = context.env.getSelf().getCode();
        pc = context.launcher.pc;
        pl = context.launcher.pl;
        openApi = context.launcher.openApi;
    }

    public Feedback reportCrossStatus(CrossStatusReport data) {
        return pc.console.crossStatus.report(data);
    }

    public Feedback reportGroupStatus(GroupStatusReport data) {
        return pc.console.groupStatus.report(data);
    }
}